//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS IoTEvents service.
///
/// AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and triggers actions when such events occur. You can use AWS IoT Events API operations to create, read, update, and delete inputs and detector models, and to list their versions.
public struct IoTEvents: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the IoTEvents client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "IoTEvents",
            serviceIdentifier: "iotevents",
            serviceProtocol: .restjson,
            apiVersion: "2018-07-27",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: IoTEventsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "iotevents-fips.ca-central-1.amazonaws.com",
            "us-east-1": "iotevents-fips.us-east-1.amazonaws.com",
            "us-east-2": "iotevents-fips.us-east-2.amazonaws.com",
            "us-gov-west-1": "iotevents-fips.us-gov-west-1.amazonaws.com",
            "us-west-2": "iotevents-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates an alarm model to monitor an AWS IoT Events input attribute. You can use the alarm to get notified when the value is outside a specified range. For more information, see Create an alarm model in the AWS IoT Events Developer Guide.
    @Sendable
    @inlinable
    public func createAlarmModel(_ input: CreateAlarmModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateAlarmModelResponse {
        try await self.client.execute(
            operation: "CreateAlarmModel", 
            path: "/alarm-models", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an alarm model to monitor an AWS IoT Events input attribute. You can use the alarm to get notified when the value is outside a specified range. For more information, see Create an alarm model in the AWS IoT Events Developer Guide.
    ///
    /// Parameters:
    ///   - alarmCapabilities: Contains the configuration information of alarm state changes.
    ///   - alarmEventActions: Contains information about one or more alarm actions.
    ///   - alarmModelDescription: A description that tells you what the alarm model detects.
    ///   - alarmModelName: A unique name that helps you identify the alarm model. You can't change this name after you create the alarm model.
    ///   - alarmNotification: Contains information about one or more notification actions.
    ///   - alarmRule: Defines when your alarm is invoked.
    ///   - key: An input attribute used as a key to create an alarm.
    ///   - roleArn: The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see Amazon Resource Names (ARNs) in the AWS General Reference.
    ///   - severity: A non-negative integer that reflects the severity level of the alarm.
    ///   - tags: A list of key-value pairs that contain metadata for the alarm model. The tags help you manage the alarm model. For more information, see Tagging your AWS IoT Events resources in the AWS IoT Events Developer Guide. You can create up to 50 tags for one alarm model.
    ///   - logger: Logger use during operation
    @inlinable
    public func createAlarmModel(
        alarmCapabilities: AlarmCapabilities? = nil,
        alarmEventActions: AlarmEventActions? = nil,
        alarmModelDescription: String? = nil,
        alarmModelName: String,
        alarmNotification: AlarmNotification? = nil,
        alarmRule: AlarmRule,
        key: String? = nil,
        roleArn: String,
        severity: Int? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateAlarmModelResponse {
        let input = CreateAlarmModelRequest(
            alarmCapabilities: alarmCapabilities, 
            alarmEventActions: alarmEventActions, 
            alarmModelDescription: alarmModelDescription, 
            alarmModelName: alarmModelName, 
            alarmNotification: alarmNotification, 
            alarmRule: alarmRule, 
            key: key, 
            roleArn: roleArn, 
            severity: severity, 
            tags: tags
        )
        return try await self.createAlarmModel(input, logger: logger)
    }

    /// Creates a detector model.
    @Sendable
    @inlinable
    public func createDetectorModel(_ input: CreateDetectorModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDetectorModelResponse {
        try await self.client.execute(
            operation: "CreateDetectorModel", 
            path: "/detector-models", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a detector model.
    ///
    /// Parameters:
    ///   - detectorModelDefinition: Information that defines how the detectors operate.
    ///   - detectorModelDescription: A brief description of the detector model.
    ///   - detectorModelName: The name of the detector model.
    ///   - evaluationMethod: Information about the order in which events are evaluated and how actions are executed.
    ///   - key: The input attribute key used to identify a device or system to create a detector (an instance of the detector model) and then to route each input received to the appropriate detector (instance). This parameter uses a JSON-path expression in the message payload of each input to specify the attribute-value pair that is used to identify the device associated with the input.
    ///   - roleArn: The ARN of the role that grants permission to AWS IoT Events to perform its operations.
    ///   - tags: Metadata that can be used to manage the detector model.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDetectorModel(
        detectorModelDefinition: DetectorModelDefinition,
        detectorModelDescription: String? = nil,
        detectorModelName: String,
        evaluationMethod: EvaluationMethod? = nil,
        key: String? = nil,
        roleArn: String,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDetectorModelResponse {
        let input = CreateDetectorModelRequest(
            detectorModelDefinition: detectorModelDefinition, 
            detectorModelDescription: detectorModelDescription, 
            detectorModelName: detectorModelName, 
            evaluationMethod: evaluationMethod, 
            key: key, 
            roleArn: roleArn, 
            tags: tags
        )
        return try await self.createDetectorModel(input, logger: logger)
    }

    /// Creates an input.
    @Sendable
    @inlinable
    public func createInput(_ input: CreateInputRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateInputResponse {
        try await self.client.execute(
            operation: "CreateInput", 
            path: "/inputs", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an input.
    ///
    /// Parameters:
    ///   - inputDefinition: The definition of the input.
    ///   - inputDescription: A brief description of the input.
    ///   - inputName: The name you want to give to the input.
    ///   - tags: Metadata that can be used to manage the input.
    ///   - logger: Logger use during operation
    @inlinable
    public func createInput(
        inputDefinition: InputDefinition,
        inputDescription: String? = nil,
        inputName: String,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateInputResponse {
        let input = CreateInputRequest(
            inputDefinition: inputDefinition, 
            inputDescription: inputDescription, 
            inputName: inputName, 
            tags: tags
        )
        return try await self.createInput(input, logger: logger)
    }

    /// Deletes an alarm model. Any alarm instances that were created based on this alarm model are also deleted. This action can't be undone.
    @Sendable
    @inlinable
    public func deleteAlarmModel(_ input: DeleteAlarmModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteAlarmModelResponse {
        try await self.client.execute(
            operation: "DeleteAlarmModel", 
            path: "/alarm-models/{alarmModelName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an alarm model. Any alarm instances that were created based on this alarm model are also deleted. This action can't be undone.
    ///
    /// Parameters:
    ///   - alarmModelName: The name of the alarm model.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteAlarmModel(
        alarmModelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteAlarmModelResponse {
        let input = DeleteAlarmModelRequest(
            alarmModelName: alarmModelName
        )
        return try await self.deleteAlarmModel(input, logger: logger)
    }

    /// Deletes a detector model. Any active instances of the detector model are also deleted.
    @Sendable
    @inlinable
    public func deleteDetectorModel(_ input: DeleteDetectorModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteDetectorModelResponse {
        try await self.client.execute(
            operation: "DeleteDetectorModel", 
            path: "/detector-models/{detectorModelName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a detector model. Any active instances of the detector model are also deleted.
    ///
    /// Parameters:
    ///   - detectorModelName: The name of the detector model to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDetectorModel(
        detectorModelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteDetectorModelResponse {
        let input = DeleteDetectorModelRequest(
            detectorModelName: detectorModelName
        )
        return try await self.deleteDetectorModel(input, logger: logger)
    }

    /// Deletes an input.
    @Sendable
    @inlinable
    public func deleteInput(_ input: DeleteInputRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteInputResponse {
        try await self.client.execute(
            operation: "DeleteInput", 
            path: "/inputs/{inputName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an input.
    ///
    /// Parameters:
    ///   - inputName: The name of the input to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteInput(
        inputName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteInputResponse {
        let input = DeleteInputRequest(
            inputName: inputName
        )
        return try await self.deleteInput(input, logger: logger)
    }

    /// Retrieves information about an alarm model. If you don't specify a value for the alarmModelVersion parameter, the latest version is returned.
    @Sendable
    @inlinable
    public func describeAlarmModel(_ input: DescribeAlarmModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeAlarmModelResponse {
        try await self.client.execute(
            operation: "DescribeAlarmModel", 
            path: "/alarm-models/{alarmModelName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves information about an alarm model. If you don't specify a value for the alarmModelVersion parameter, the latest version is returned.
    ///
    /// Parameters:
    ///   - alarmModelName: The name of the alarm model.
    ///   - alarmModelVersion: The version of the alarm model.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeAlarmModel(
        alarmModelName: String,
        alarmModelVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeAlarmModelResponse {
        let input = DescribeAlarmModelRequest(
            alarmModelName: alarmModelName, 
            alarmModelVersion: alarmModelVersion
        )
        return try await self.describeAlarmModel(input, logger: logger)
    }

    /// Describes a detector model. If the version parameter is not specified, information about the latest version is returned.
    @Sendable
    @inlinable
    public func describeDetectorModel(_ input: DescribeDetectorModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeDetectorModelResponse {
        try await self.client.execute(
            operation: "DescribeDetectorModel", 
            path: "/detector-models/{detectorModelName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes a detector model. If the version parameter is not specified, information about the latest version is returned.
    ///
    /// Parameters:
    ///   - detectorModelName: The name of the detector model.
    ///   - detectorModelVersion: The version of the detector model.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeDetectorModel(
        detectorModelName: String,
        detectorModelVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeDetectorModelResponse {
        let input = DescribeDetectorModelRequest(
            detectorModelName: detectorModelName, 
            detectorModelVersion: detectorModelVersion
        )
        return try await self.describeDetectorModel(input, logger: logger)
    }

    /// Retrieves runtime information about a detector model analysis.  After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis results.
    @Sendable
    @inlinable
    public func describeDetectorModelAnalysis(_ input: DescribeDetectorModelAnalysisRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeDetectorModelAnalysisResponse {
        try await self.client.execute(
            operation: "DescribeDetectorModelAnalysis", 
            path: "/analysis/detector-models/{analysisId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves runtime information about a detector model analysis.  After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis results.
    ///
    /// Parameters:
    ///   - analysisId: The ID of the analysis result that you want to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeDetectorModelAnalysis(
        analysisId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeDetectorModelAnalysisResponse {
        let input = DescribeDetectorModelAnalysisRequest(
            analysisId: analysisId
        )
        return try await self.describeDetectorModelAnalysis(input, logger: logger)
    }

    /// Describes an input.
    @Sendable
    @inlinable
    public func describeInput(_ input: DescribeInputRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeInputResponse {
        try await self.client.execute(
            operation: "DescribeInput", 
            path: "/inputs/{inputName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes an input.
    ///
    /// Parameters:
    ///   - inputName: The name of the input.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeInput(
        inputName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeInputResponse {
        let input = DescribeInputRequest(
            inputName: inputName
        )
        return try await self.describeInput(input, logger: logger)
    }

    /// Retrieves the current settings of the AWS IoT Events logging options.
    @Sendable
    @inlinable
    public func describeLoggingOptions(_ input: DescribeLoggingOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeLoggingOptionsResponse {
        try await self.client.execute(
            operation: "DescribeLoggingOptions", 
            path: "/logging", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the current settings of the AWS IoT Events logging options.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @inlinable
    public func describeLoggingOptions(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeLoggingOptionsResponse {
        let input = DescribeLoggingOptionsRequest(
        )
        return try await self.describeLoggingOptions(input, logger: logger)
    }

    /// Retrieves one or more analysis results of the detector model.  After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis results.
    @Sendable
    @inlinable
    public func getDetectorModelAnalysisResults(_ input: GetDetectorModelAnalysisResultsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDetectorModelAnalysisResultsResponse {
        try await self.client.execute(
            operation: "GetDetectorModelAnalysisResults", 
            path: "/analysis/detector-models/{analysisId}/results", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves one or more analysis results of the detector model.  After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis results.
    ///
    /// Parameters:
    ///   - analysisId: The ID of the analysis result that you want to retrieve.
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDetectorModelAnalysisResults(
        analysisId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDetectorModelAnalysisResultsResponse {
        let input = GetDetectorModelAnalysisResultsRequest(
            analysisId: analysisId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.getDetectorModelAnalysisResults(input, logger: logger)
    }

    /// Lists all the versions of an alarm model. The operation returns only the metadata associated with each alarm model version.
    @Sendable
    @inlinable
    public func listAlarmModelVersions(_ input: ListAlarmModelVersionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAlarmModelVersionsResponse {
        try await self.client.execute(
            operation: "ListAlarmModelVersions", 
            path: "/alarm-models/{alarmModelName}/versions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all the versions of an alarm model. The operation returns only the metadata associated with each alarm model version.
    ///
    /// Parameters:
    ///   - alarmModelName: The name of the alarm model.
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAlarmModelVersions(
        alarmModelName: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAlarmModelVersionsResponse {
        let input = ListAlarmModelVersionsRequest(
            alarmModelName: alarmModelName, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAlarmModelVersions(input, logger: logger)
    }

    /// Lists the alarm models that you created. The operation returns only the metadata associated with each alarm model.
    @Sendable
    @inlinable
    public func listAlarmModels(_ input: ListAlarmModelsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAlarmModelsResponse {
        try await self.client.execute(
            operation: "ListAlarmModels", 
            path: "/alarm-models", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the alarm models that you created. The operation returns only the metadata associated with each alarm model.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAlarmModels(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAlarmModelsResponse {
        let input = ListAlarmModelsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAlarmModels(input, logger: logger)
    }

    /// Lists all the versions of a detector model. Only the metadata associated with each detector model version is returned.
    @Sendable
    @inlinable
    public func listDetectorModelVersions(_ input: ListDetectorModelVersionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDetectorModelVersionsResponse {
        try await self.client.execute(
            operation: "ListDetectorModelVersions", 
            path: "/detector-models/{detectorModelName}/versions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all the versions of a detector model. Only the metadata associated with each detector model version is returned.
    ///
    /// Parameters:
    ///   - detectorModelName: The name of the detector model whose versions are returned.
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDetectorModelVersions(
        detectorModelName: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDetectorModelVersionsResponse {
        let input = ListDetectorModelVersionsRequest(
            detectorModelName: detectorModelName, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDetectorModelVersions(input, logger: logger)
    }

    /// Lists the detector models you have created. Only the metadata associated with each detector model is returned.
    @Sendable
    @inlinable
    public func listDetectorModels(_ input: ListDetectorModelsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDetectorModelsResponse {
        try await self.client.execute(
            operation: "ListDetectorModels", 
            path: "/detector-models", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the detector models you have created. Only the metadata associated with each detector model is returned.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDetectorModels(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDetectorModelsResponse {
        let input = ListDetectorModelsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDetectorModels(input, logger: logger)
    }

    ///  Lists one or more input routings.
    @Sendable
    @inlinable
    public func listInputRoutings(_ input: ListInputRoutingsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListInputRoutingsResponse {
        try await self.client.execute(
            operation: "ListInputRoutings", 
            path: "/input-routings", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Lists one or more input routings.
    ///
    /// Parameters:
    ///   - inputIdentifier:  The identifer of the routed input.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - nextToken:  The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listInputRoutings(
        inputIdentifier: InputIdentifier,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListInputRoutingsResponse {
        let input = ListInputRoutingsRequest(
            inputIdentifier: inputIdentifier, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listInputRoutings(input, logger: logger)
    }

    /// Lists the inputs you have created.
    @Sendable
    @inlinable
    public func listInputs(_ input: ListInputsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListInputsResponse {
        try await self.client.execute(
            operation: "ListInputs", 
            path: "/inputs", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the inputs you have created.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to be returned per request.
    ///   - nextToken: The token that you can use to return the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listInputs(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListInputsResponse {
        let input = ListInputsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listInputs(input, logger: logger)
    }

    /// Lists the tags (metadata) you have assigned to the resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags (metadata) you have assigned to the resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Sets or updates the AWS IoT Events logging options. If you update the value of any loggingOptions field, it takes up to one minute for the change to take effect. If you change the policy attached to the role you specified in the roleArn field (for example, to correct an invalid policy), it takes up to five minutes for that change to take effect.
    @Sendable
    @inlinable
    public func putLoggingOptions(_ input: PutLoggingOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "PutLoggingOptions", 
            path: "/logging", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sets or updates the AWS IoT Events logging options. If you update the value of any loggingOptions field, it takes up to one minute for the change to take effect. If you change the policy attached to the role you specified in the roleArn field (for example, to correct an invalid policy), it takes up to five minutes for that change to take effect.
    ///
    /// Parameters:
    ///   - loggingOptions: The new values of the AWS IoT Events logging options.
    ///   - logger: Logger use during operation
    @inlinable
    public func putLoggingOptions(
        loggingOptions: LoggingOptions,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = PutLoggingOptionsRequest(
            loggingOptions: loggingOptions
        )
        return try await self.putLoggingOptions(input, logger: logger)
    }

    /// Performs an analysis of your detector model. For more information,  see Troubleshooting a detector model  in the AWS IoT Events Developer Guide.
    @Sendable
    @inlinable
    public func startDetectorModelAnalysis(_ input: StartDetectorModelAnalysisRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartDetectorModelAnalysisResponse {
        try await self.client.execute(
            operation: "StartDetectorModelAnalysis", 
            path: "/analysis/detector-models", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Performs an analysis of your detector model. For more information,  see Troubleshooting a detector model  in the AWS IoT Events Developer Guide.
    ///
    /// Parameters:
    ///   - detectorModelDefinition: 
    ///   - logger: Logger use during operation
    @inlinable
    public func startDetectorModelAnalysis(
        detectorModelDefinition: DetectorModelDefinition,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartDetectorModelAnalysisResponse {
        let input = StartDetectorModelAnalysisRequest(
            detectorModelDefinition: detectorModelDefinition
        )
        return try await self.startDetectorModelAnalysis(input, logger: logger)
    }

    /// Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource.
    ///   - tags: The new or modified tags for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes the given tags (metadata) from the resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes the given tags (metadata) from the resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource.
    ///   - tagKeys: A list of the keys of the tags to be removed from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.
    @Sendable
    @inlinable
    public func updateAlarmModel(_ input: UpdateAlarmModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateAlarmModelResponse {
        try await self.client.execute(
            operation: "UpdateAlarmModel", 
            path: "/alarm-models/{alarmModelName}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.
    ///
    /// Parameters:
    ///   - alarmCapabilities: Contains the configuration information of alarm state changes.
    ///   - alarmEventActions: Contains information about one or more alarm actions.
    ///   - alarmModelDescription: The description of the alarm model.
    ///   - alarmModelName: The name of the alarm model.
    ///   - alarmNotification: Contains information about one or more notification actions.
    ///   - alarmRule: Defines when your alarm is invoked.
    ///   - roleArn: The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see Amazon Resource Names (ARNs) in the AWS General Reference.
    ///   - severity: A non-negative integer that reflects the severity level of the alarm.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateAlarmModel(
        alarmCapabilities: AlarmCapabilities? = nil,
        alarmEventActions: AlarmEventActions? = nil,
        alarmModelDescription: String? = nil,
        alarmModelName: String,
        alarmNotification: AlarmNotification? = nil,
        alarmRule: AlarmRule,
        roleArn: String,
        severity: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateAlarmModelResponse {
        let input = UpdateAlarmModelRequest(
            alarmCapabilities: alarmCapabilities, 
            alarmEventActions: alarmEventActions, 
            alarmModelDescription: alarmModelDescription, 
            alarmModelName: alarmModelName, 
            alarmNotification: alarmNotification, 
            alarmRule: alarmRule, 
            roleArn: roleArn, 
            severity: severity
        )
        return try await self.updateAlarmModel(input, logger: logger)
    }

    /// Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.
    @Sendable
    @inlinable
    public func updateDetectorModel(_ input: UpdateDetectorModelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateDetectorModelResponse {
        try await self.client.execute(
            operation: "UpdateDetectorModel", 
            path: "/detector-models/{detectorModelName}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.
    ///
    /// Parameters:
    ///   - detectorModelDefinition: Information that defines how a detector operates.
    ///   - detectorModelDescription: A brief description of the detector model.
    ///   - detectorModelName: The name of the detector model that is updated.
    ///   - evaluationMethod: Information about the order in which events are evaluated and how actions are executed.
    ///   - roleArn: The ARN of the role that grants permission to AWS IoT Events to perform its operations.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateDetectorModel(
        detectorModelDefinition: DetectorModelDefinition,
        detectorModelDescription: String? = nil,
        detectorModelName: String,
        evaluationMethod: EvaluationMethod? = nil,
        roleArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateDetectorModelResponse {
        let input = UpdateDetectorModelRequest(
            detectorModelDefinition: detectorModelDefinition, 
            detectorModelDescription: detectorModelDescription, 
            detectorModelName: detectorModelName, 
            evaluationMethod: evaluationMethod, 
            roleArn: roleArn
        )
        return try await self.updateDetectorModel(input, logger: logger)
    }

    /// Updates an input.
    @Sendable
    @inlinable
    public func updateInput(_ input: UpdateInputRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateInputResponse {
        try await self.client.execute(
            operation: "UpdateInput", 
            path: "/inputs/{inputName}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an input.
    ///
    /// Parameters:
    ///   - inputDefinition: The definition of the input.
    ///   - inputDescription: A brief description of the input.
    ///   - inputName: The name of the input you want to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateInput(
        inputDefinition: InputDefinition,
        inputDescription: String? = nil,
        inputName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateInputResponse {
        let input = UpdateInputRequest(
            inputDefinition: inputDefinition, 
            inputDescription: inputDescription, 
            inputName: inputName
        )
        return try await self.updateInput(input, logger: logger)
    }
}

extension IoTEvents {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: IoTEvents, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
